<template>
  <div class="home" >
    <div class="litle">
    <el-container>
      <div class="title">
        <el-header height="60px">
        <div class="menu">
        <div class="log">
          <img src="../assets/images/logo.jpg" />
          <span class="el-name">猿E科技</span>
        </div>
        <el-menu
          :default-active="activeIndex"
          class="el-menu-demo"
          mode="horizontal"
          @select="handleSelect"
          background-color="#fff"
          text-color="#000"
          active-text-color="#2385d5"
          router
        >
          <template v-for="item in itemsMap">
              <template v-if="item.subs">
                <el-submenu :index="item.index" :key="item.index">
                  <template slot="title">{{item.value}}</template>
                  <el-menu-item v-for="sub in item.subs" :key="sub.index" :index="sub.index">{{sub.value}}</el-menu-item>
                </el-submenu>
              </template>
              <template v-else>
                  <el-menu-item  :key="item.index" :index="item.index">{{item.value}}</el-menu-item>
              </template>
          </template>
        </el-menu>
         </div>
      </el-header>
       </div>
      <div class="content">
      <el-main class="main" :style="minHeight">
         <router-view class="animated bounceInDown"></router-view>
      </el-main>
      <div class="footer-box" ref="footer" :style="'width:'+ footerWidth + 'px'" >
        <div class="footer">
            <img src="../assets/images/wx.png" alt="">
            <div class="foot-text">
             <p> 猿E创意科技团队</p>
              <ul class="left">
                <li> <i class="iconfont pic1">&#xe68c;</i>2635882700</li>
                <li><i class="iconfont pic2">&#xe689;</i>1374543195@qq.com</li>
              </ul>
              <ul class="right"> <li><i class="iconfont pic">&#xe6ab;</i><a href="http://bodboy.gitee.io/blog/" target="_blank">http://bodboy.gitee.io/blog/</a></li>
                <li><i class="iconfont pic">&#xe66f;</i><a href="https://juejin.im/user/1732486058751982" target="_blank">https://juejin.im/user/1732486058751982</a></li>
                </ul>
            </div>
        </div>
        <div class="bottom">
           <span>猿e创意科技团队-版权所有</span>
            <span>备案号:鄂ICP备19031494</span>
            <span style="marginLeft:10px">技术支持:帕丁熊 猿小e</span>
        </div>
     </div>
      </div>
    </el-container>
  </div>
  </div>
</template>

<script>

import {mapState} from 'vuex'
export default {
  data (){
    return {
      activeIndex:'home',
      minHeight:{
        minHeight:''
      },
      footerWidth:0
    }
  },
  computed:{
    ...mapState({
      itemsMap:state => state.menu.items
    })
  },
  methods : {
    handleSelect(key){
      this.activeIndex = key
    },
    exports(){


    },
    getHeight(){
      // 获取footer的高度 
      var height = this.$refs.footer.offsetHeight;
      this.footerWidth = window.innerWidth - 21 ;
      this.minHeight.minHeight = window.innerHeight  - 60 - height + 'px';
      let windowsInfo = {
         height : window.innerHeight +'px',
         width : window.innerWidth- 21 +'px'
      }
      this.$store.commit('setWindowsInfo',windowsInfo)
    }
  },
  mounted(){
    window.addEventListener('resize',this.getHeight);
    this.getHeight();
  },
  destroyed (){
    window.removeEventListener('resize',this.getHeight);
  }
};
</script>


<style scoped lang="scss">
@import "../assets/font/iconfont.css";
.home {
      .title{
    position: fixed;
    top: 0;
    width: 100%;
     z-index: 10;
     background-color: rgb(255, 255, 255);
    -shadow: 0px 10px 50px 10px rgba(133, 179, 209, 0.1);
    .el-header {
      overflow: hidden;
      padding:0;
     width:1426px;
      margin: auto auto;
     line-height: 60px;
    .menu{
      overflow: hidden;
      height: 60px;
      width: 100%;
    .log {
      float: left;
      height: 60px;
      line-height: 50px;
      img {
        width:70px;
        height: 40px;
        line-height: 60px;
        vertical-align: middle;
      }

      .el-name {
        font-family: "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif;
        font-size: 18px;
        margin-left: 10px;
      }
    }
    .el-menu-demo{
      float: right;
     
      .el-menu-item.is-active {
          border-bottom: none!important;
      }
      /* 整体的下划线进行隐藏 */
      .el-menu.el-menu--horizontal{
        border-bottom: none;
      }
      .el-menu-item {
        padding: 0 45px;
        font-size: 16px;
        border-bottom: none!important;
      }
     
      .el-menu-item:hover{
        color:#2385d5 !important;
        background-color:#F7F8FA !important;
      }

      /* .el-menu--horizontal>.el-menu-item{
          border-bottom: none;
      }
      .el-menu--horizontal>.el-menu-item:not(.is-disabled):focus, .el-menu--horizontal>.el-menu-item:not(.is-disabled):hover, .el-menu--horizontal>.el-submenu .el-submenu__title:hover {
          background-color:#fff !important;
          border-bottom: none !important;
      } */
    }
  }
  }
      }
  .content{
    width: 100%;
    margin-top: 60px;
    .main{
      min-width: 1426px;
    }
  }
  
  .el-main {
    color: #333;
    text-align: center;
    background: #f5f5f5;
    width: 100%;
    padding: 0;
  }

  .footer-box{
    width: 100%;
    background-color: #323232;
    overflow: hidden;
    color:rgba(143, 143, 143, 0.5);
     .footer{
    width: 80%;
    margin: 20px auto;
    padding: 50px 20px ;
    line-height: 40px;
    overflow: hidden;
    // text-align: center;
    font-size: 16px;
    color: rgb(173, 173, 173);
    vertical-align: middle;
    img{
      width: 150px;
      height: 150px;
      float: left;
      margin:0 5% 0 20%;
    }
    .foot-text{
      float: left;
      p{
        margin-bottom: 15px;
        font-family: '楷体';
       font-size: 25px;
      }
      .pic{
        margin-right: 10px;
        font-size: 20px;
      }
      .pic1{
        font-size: 21px ;
        margin-right: 10px;
      }
      .pic2{
        font-size: 25px;
        margin-right: 5px;
      }
      a{
        color: rgb(173, 173, 173);
      }
      .left{
        float: left;
      }
      .right {
        float: right;
        margin-left: 25px;
      }

    }
    

    
    // span{
    //   margin-right: 15px;
    // }
  }
  .bottom{
      border-top: 0.5px solid rgba(110,110,110,0.5);
      font-size: 15px;
      text-align: center;
      line-height: 30px;
    }
  }
 
}
</style>
